﻿Imports NENAData.LINQ
Imports NENAData.NENAMember
Imports NENAData.Transactions.Payments

Partial Public Class ActivatePayPal
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


    End Sub

    Private Sub Activate(ByVal intAffiliateID As Integer, ByVal intMemberID As Integer, ByVal intTransactionPaymentID As Integer)
        'already completed
        'Dim oActivate As Account.Activate = New Account.Activate
        'oActivate.MembershipAccount(intAffiliateID, intMemberID, False, NENAData.Payments.NENAPayments.PaidBy.PayPal, intTransactionPaymentID)

    End Sub

    Protected Sub Button1050_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1050.Click
        Activate(3, 1050, 119)
    End Sub

    Protected Sub ButtonAll_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ButtonAll.Click

        Try

            Dim oPayments As NENAData.Transactions.Payments.Payments = New Payments
            Dim tp As List(Of TransactionPayment)

            tp = oPayments.GetPaidby(NENAData.Payments.NENAPayments.PaidBy.PayPal)

            For Each ltp In tp
                Activate(ltp.PaymentTo, ltp.Member_ID, ltp.TransactionPaymentID)
                Response.Write("Member_ID: " & ltp.Member_ID.ToString)
                Response.Write(" affiliate_id: " & ltp.PaymentTo.ToString)
                Response.Write(" affiliate_id: " & ltp.TransactionPaymentID.ToString)
                Response.Write(" is now Activated<br />")
            Next

        Catch ex As Exception
            Response.Write("Error Message: " & ex.Message.ToString)

        End Try

    End Sub
End Class